import game
import sys
import traceback

# 负责外层启动

def run(argv):
    argv = argv[1:]
    try:
        g = game.Game()
        g.start()
    except KeyboardInterrupt:
        g.saveNow()
        return
    except Exception as e:
        if "dev" in argv:
            raise
        g.saveNow()
    finally:
        g.saveNow()

run(sys.argv)